#pragma once

#include "action.h"
#include "button.h"

class Action_ButtonState : public Action
{
	Button * m_button;
	bool m_oldState, m_newState;
protected:
	Action_ChangeReferences(Button * a_button, bool a_newValue)
		:m_button(a_button),m_oldState(m_button->isOn()),m_newState(a_newValue){}
	bool redo(){	if(m_button)m_button->setOn(m_newState);	}
	bool undo(){	if(m_button)m_button->setOn(m_newState);	}
	bool isActualChange(){return m_oldState != m_newState;}
};